package com.apartment.common.utils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class StringSplit {

    public static final String SEPARATOR = ",";

    public static List<String> split(String str){
        String[] list = str.split(SEPARATOR,0);
        List<String> list1 =new ArrayList<>(Arrays.asList(list));
        return list1;
    }
    public static String append(List list){
        if(list == null  || list.size() == 0 ){
            return "null";
        }
        StringBuilder stringBuilder = new StringBuilder("");
        list.forEach(i ->{
            stringBuilder.append(i).append(SEPARATOR);
        });
        return stringBuilder.toString();
    }

}
